<?php

function bidding($articleid, $eventid, $bid){
	$c = connect();
	#Validate
	$r = mysql_query("SELECT * FROM submissions WHERE articles_idarticles = '".$articleid"'")
	if(mysql_num_rows($r) == 0){
		mysql_close($c);
		return false;
	}

	mysql_query("INSERT INTO biddings 
		(submissions_articles_idarticles, subscribers_events_idevents, subscribers_users_idusers, bid) 
		VALUES ('".$articleid."','".$eventid."','".$_SESSION['idusers']."','".$bid."') 
		ON DUPLICATE KEY UPDATE bid = '".$bid."'");
	mysql_close($c);
	return true;
}

?>
